sdcolorspace module

class sd.api.sdcolorspace.SDColorSpace(APIContext, handle, *args, **kwargs)

Bases: sd.api.sdapiobject.SDAPIObject

A set of helper functions to convert colors from one color-space to another

getClassName() → str

Returns the most specific name of the class this APIObject is

release() → None

Releases an APIObject

static sConvert(value: float, valueColorSpaceName: str, dstColorSpaceName: str) → float

Convert a float value from one color space to another. Supported color space names are: ‘sRGB’, ‘Linear’

Parameters
  • value – The float value to convert

  • valueColorSpaceName – The color space of the provided value

  • dstColorSpaceName – The color space wanted for the output value

static sConvertColorRGB(value: sd.api.sdbasetypes.ColorRGB, valueColorSpaceName: str, dstColorSpaceName: str) → sd.api.sdbasetypes.ColorRGB

Convert a ColorRGB value from one color space to another. Supported color space names are: ‘sRGB’, ‘Linear’

Parameters
  • value – The float value to convert

  • valueColorSpaceName – The color space of the provided value

  • dstColorSpaceName – The color space wanted for the output value

static sConvertColorRGBA(value: sd.api.sdbasetypes.ColorRGBA, valueColorSpaceName: str, dstColorSpaceName: str) → sd.api.sdbasetypes.ColorRGBA

Convert a ColorRGBA value from one color space to another. Supported color space names are: ‘sRGB’, ‘Linear’. Alpha component is left unchanged

Parameters
  • value – The float value to convert

  • valueColorSpaceName – The color space of the provided value

  • dstColorSpaceName – The color space wanted for the output value